import { defineComponent } from "vue";
import style from "./index.module.less";
import { roundImgProps } from "./types";
import { getSize } from "@/command/apiTool";
export default defineComponent({
  name: "",
  emits: ["click"],
  props: roundImgProps,
  setup(_, { slots, emit }) {
    return () => {
      if (!_.src) return null;
      return (
        <div
          class="w-[45px] h-[45px] round-img"
          style={{
            // minWidth: getSize(45),
            // minHeight: getSize(45),
            backgroundImage: `url(${_.src})`,
            backgroundSize: "100% 100%",
            borderRadius: "50%",
          }}
          onClick={(e) => {
            e.stopPropagation();
            e.preventDefault();
            emit("click");
          }}
        />
      );
    };
  },
});
